package com.coolingme.course;

/**
 * Java课程，需要做作业
 *
 * @author wangyue
 * @date 2020-09-21 22:11
 */
public class JavaCourse extends AbstractCourse {

    /**
     * 自己控制是否需要写作业
     */
    private boolean needHomework = false;

    public void setNeedHomework(boolean needHomework) {
        this.needHomework = needHomework;
    }

    @Override
    protected boolean needHomework() {
        return needHomework;
    }

    @Override
    protected void doHomework() {
        System.out.println("做Java作业");
    }

    @Override
    public void preview() {
        System.out.println("预习Java");
    }

    @Override
    protected void learn() {
        System.out.println("学习Java");
    }
}
